/* SGATOR
 * mod.h
 */

#ifndef SGMOD_H
#define SGMOD_H

#include "base.h"
#include "types.h"

#define SG_MODMAXFBSZ 25600

struct _SgMod {
  SgUInt _cid;
  SgBool _stl;
  SgBool _isready;
  SgSingle samplerate;
  SgULong sample;
  SgULong buffsize;
  SgList *buffs;
  SgList *freebuffs;
  SgUInt fbnb;
  SgFloat *iunbuff;
  SgFloat *ounbuff;
  SgList *elems;
  SgElem *inp_elem;
  SgElem *out_elem;
  SgStack *oth_elems;
};

SgMod *sg_make_mod(SgSingle samplerate, SgULong buffsize);
void sg_free_mod(SgMod *mod);
void sg_rmbuff(SgMod *mod, SgList *br);
SgList *sg_newbuff(SgMod *mod);
void sg_mod_prepare(SgMod *mod);
void sg_mod_set_inpelem(SgElem *elem);
void sg_mod_set_outelem(SgElem *elem);
void sg_mod_add_other_elem(SgElem *elem);

#endif

/* end */

